package com.zatech.cgnci.project.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @author EDY
 * @version 1.0
 * Create by 2024/12/18 14:03
 */
@Data
@ApiModel(value = "CgnciReInsuranceCompanyMainSaveOrUpdateDTO")
public class CgnciReInsuranceCompanySaveOrUpdateDTO {

    @ApiModelProperty(value = "工作流类型,固定值:submit")
    private String flowTaskType;

    @ApiModelProperty(value = "任务流程id")
    @NotNull(message = "approvalInfoId cannot be null")
    private Long approvalInfoId;

    @ApiModelProperty(value = "基本信息/纳税人信息")
    @Valid
    private CgnciReInsuranceCompanyDTO reInsuranceCompanyDTO;

    @ApiModelProperty(value = "账户信息")
    @Valid
    private List<ReInsuranceCompanyAccountDTO> accountDTOList;

    @ApiModelProperty(value = "文件清单")
    private List<AccessoryDTO> accessoryDTOList;

    @Data
    public static class CgnciReInsuranceCompanyDTO {

        @ApiModelProperty("id")
        @NotNull(message = "id cannot be null")
        private Long id;

        @ApiModelProperty("公司类型(1-再保险公司, 2-再保经纪公司),码表值:companyType")
        private String companyType;

        @ApiModelProperty("公司属性(1-一般再保公司, 2-专业再保公司),码表值:companyProperty")
        private String companyProperty;

        @ApiModelProperty("公司代码")
        private String companyCode;

        @ApiModelProperty("公司中文名称")
        private String companyNameCn;

        @ApiModelProperty("公司英文名称")
        private String companyNameEn;

        @ApiModelProperty("所在地区分类(1-境内, 2-境外),码表值:domestic_andForeign")
        private String regionType;

        @ApiModelProperty("所属国家/地区")
        private String countryRegion;

        @ApiModelProperty("所在城市")
        private String city;

        @ApiModelProperty("是否关联方(1-是, 0-否),码表值:isYes")
        private String isAffiliated;

        @ApiModelProperty("联系地址-省")
        private String contactProvince;

        @ApiModelProperty("联系地址-省code")
        private String contactProvinceCode;

        @ApiModelProperty("联系地址-市")
        private String contactCity;

        @ApiModelProperty("联系地址-市code")
        private String contactCityCode;

        @ApiModelProperty("联系地址-区")
        private String contactDistrict;

        @ApiModelProperty("联系地址-区code")
        private String contactDistrictCode;

        @ApiModelProperty("联系地址-详细")
        private String contactAddress;

        @ApiModelProperty("评级Code")
        private String ratingCode;

        @ApiModelProperty("评级")
        private String rating;

        @ApiModelProperty("评级机构(1-AM BEST, 2-标普, 3-其他),码表值:ratingAgency")
        private String ratingAgency;

        @ApiModelProperty("其他评级机构")
        private String otherRatingAgency;

        @ApiModelProperty("评级日期")
        @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT-8")
        private Date ratingDate;

        @ApiModelProperty("资本金币种")
        private String capitalCurrency;

        @ApiModelProperty("资本金金额")
        private BigDecimal capitalAmount;

        @ApiModelProperty("资本公积金币种")
        private String reserveCurrency;

        @ApiModelProperty("资本公积金金额")
        private BigDecimal reserveAmount;

        @ApiModelProperty("偿付能力")
        private BigDecimal solvencyCapability;

        @ApiModelProperty("偿付能力更新日期")
        @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT-8")
        private Date solvencyUpdateDate;

        @ApiModelProperty("是否境内独立法人(1-是, 0-否),码表值:isYes")
        private String isDomesticLegalEntity;

        @ApiModelProperty("偿还意愿(1-强, 2-中, 3-弱),码表值:repaymentWillingness")
        private String repaymentWillingness;

        @ApiModelProperty("再保险接受人风险偏好")
        private String riskPreference;

        @ApiModelProperty("保监会登记代码")
        private String circRegistrationCode;

        @ApiModelProperty("保监统信ID")
        private String circId;

        @ApiModelProperty("最终风险承担者名称")
        private String ultimateRiskBearerName;

        @ApiModelProperty("最终风险承担者所在国家或地区")
        private String ultimateRiskBearerCountryRegion;

        @ApiModelProperty("最终风险承担者所在市场(1-中国境内, 2-中国香港, 3-中国台湾, 4-中国澳门),码表值:ultimateRiskBearerMarket")
        private String ultimateRiskBearerMarket;

        @ApiModelProperty("开票类型(1-增值税普通发票, 2-增值税专用发票),码表值:invoiceType")
        private String invoiceType;

        @ApiModelProperty("纳税人类别(1-一般纳税人, 2-小规模纳税人, 3-非增值税纳税人),码表值:taxpayerType")
        private String taxpayerType;

        @ApiModelProperty("纳税人识别号")
        private String taxpayerId;

        @ApiModelProperty("税务注册地址")
        private String taxRegistrationAddress;

        @ApiModelProperty("税务联系电话")
        private String taxContactPhone;

        @ApiModelProperty("开户银行")
        private String taxBankName;

        @ApiModelProperty("银行账号")
        private String taxBankAccount;

        @ApiModelProperty("再保人所在地(1-境内, 2-境外),码表值:domestic_andForeign")
        private String insuredLocation;

        @ApiModelProperty("税率")
        private BigDecimal taxRate;

    }

    @Data
    public static class ReInsuranceCompanyAccountDTO {

        @ApiModelProperty(value = "id")
        private Long id;

        @ApiModelProperty(value = "收款人账户名称")
        private String accountName;

        @ApiModelProperty(value = "开户银行")
        private String bankName;

        @ApiModelProperty(value = "银行地址-省Code")
        private String bankProvinceCode;

        @ApiModelProperty(value = "银行地址-市Code")
        private String bankCityCode;

        @ApiModelProperty(value = "银行地址-区Code")
        private String bankDistrictCode;

        @ApiModelProperty(value = "银行地址-详细")
        private String bankAddress;

        @ApiModelProperty(value = "银行账号")
        private String bankAccount;

        @ApiModelProperty(value = "币种")
        private String currency;

        @ApiModelProperty(value = "账户类型(1-再保),码表值:accountType")
        private String accountType;

    }

    @Data
    public static class AccessoryDTO {

        @NotNull(message = "文件id不能为空")
        @ApiModelProperty(value = "文件id")
        private Long accId;

        @ApiModelProperty(value = "业务编号(关联业务表主键id)", hidden = true)
        private Long businessId;

        @ApiModelProperty(value = "业务号", hidden = true)
        private String businessNo;

        @ApiModelProperty(value = "业务类型（根据业务自定义业务类型进行区分）", hidden = true)
        private String businessType;

        @ApiModelProperty(value = "文件类型", hidden = true)
        private String accType;

        @ApiModelProperty(value = "上传节点", hidden = true)
        private String uploadNode;

        @ApiModelProperty(value = "附件云编号", hidden = true)
        private String fileId;

        @ApiModelProperty(value = "附件名称", hidden = true)
        private String fileName;

        @ApiModelProperty(value = "附件类型", hidden = true)
        private String fileType;

        @ApiModelProperty(value = "有效起期", hidden = true)
        private Date startTime;

        @ApiModelProperty(value = "有效止期", hidden = true)
        private Date endTime;

        @ApiModelProperty(value = "上传时间", hidden = true)
        private Date uploadTime;

        @ApiModelProperty(value = "状态（0：失败，1：成功）", hidden = true)
        private String status;

        @ApiModelProperty(value = "操作结果描述", hidden = true)
        private String msg;

        @ApiModelProperty(value = "删除标志位（0：未删除，1：已删除）", hidden = true)
        private Integer dr;

    }
}
